<!DOCTYPE html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <title>土豪520</title>
    <meta name="description" content="">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui, user-scalable=no">
    <meta http-equiv="cleartype" content="on">
    <meta name="format-detection" content="telephone=no">
    <link rel="stylesheet" href="/assets/activity/lighting/css/index.css">
    <link rel="stylesheet" href="/assets/activity/lighting/css/font.css">
	<link rel="stylesheet" type="text/css" href="/assets/activity/lighting/css/notice.css" />
	<script src="/assets/activity/lighting/js/notice.js"></script>
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<style>
		.share {
		    margin: 12px 0 20px 50%;
		    width: 40%;
		}
		.share-btn {
		    background: none repeat scroll 0 0 #20ab98;
		    border-radius: 4px;
		    display: inline-block;
		    font-size: 14px;
		    margin-top: 30px;
		    padding: 4px 15px;
		    width: 114px;
		}
	</style>
	<script type="text/javascript">
	wx.config({
		debug: false,
		appId: "{BEESCRM:$appid}",
		timestamp: "{BEESCRM:$timestamp}",
		nonceStr: "{BEESCRM:$noncestr}",
		signature: "{BEESCRM:$signature}",
		jsApiList: ['checkJsApi','onMenuShareTimeline','onMenuShareAppMessage','hideOptionMenu','scanQRCode'],
	});
	
	wx.ready(function(){
		var url = '{BEESCRM:$share_url}';
		var imgUrl = '{BEESCRM:$share_image}';
		var title = '{BEESCRM:$share_title}';
		var desc = '{BEESCRM:$share_desc}';
		//分享到朋友圈
		wx.onMenuShareTimeline({
			title: title, // 分享标题
			link: url, // 分享链接
			imgUrl: imgUrl, // 分享图标
			success: function () { 
				share(); 
			},
			cancel: function () { 
				// 用户取消分享后执行的回调函数
				/* alert('已取消'); */
			}
		});
		//发送给好友
		wx.onMenuShareAppMessage({
			title: title, // 分享标题
			desc: desc, // 分享描述
			link: url, // 分享链接
			imgUrl: imgUrl, // 分享图标
			success: function () { 
				// 用户确认分享后执行的回调函数
				share();
			},
			cancel: function () { 
				// 用户取消分享后执行的回调函数
			}
		});
	});
	//分享
	var act_id = '{BEESCRM:$act_id}';
	var wechat_id = '{BEESCRM:$wechat_id}';
	var fans_id = '{BEESCRM:$fans_id}';
	<if condition="$from_fans_id">
		var from_fans_id = '{BEESCRM:$from_fans_id}';
	<else/>
		var from_fans_id = '{BEESCRM:$fans_id}';
	</if>
	var origin = '{BEESCRM:$origin}';
	if(!origin){
		origin = 'share';
	}
	var share_callback_url = "/activity/lighting/share/act_id/"+act_id+"/wechat_id/"+wechat_id+"/fans_id/"+fans_id+"/from_fans_id/"+from_fans_id+"/origin/"+origin+"/action_name/index";
//	alert(share_callback_url);
//	console.log(share_callback_url);
	//分享log
	function share(){
		var url;
		url = share_callback_url;
		$.ajax({
			type:'post',
			dataType:'json',
			url:url,
		});
	}  
</script>
</head>

<body>
<div class="wraper">
    <div class="logo">
    <if condition="$subscribe eq 0 " >
        <a href="{BEESCRM:$subscribe_url}" class="top">
            <img src="/assets/activity/lighting/images/hongyan.png">
            <span>关注鸿雁公众号，随时获取中奖信息</span>
            <span class="concern fl-right">关注<span class="iconfont icon-youjiantou2"></span></span>
        </a>
    <elseif condition="$subscribe eq 1"/>
    	<a href="javascript:void(0)" class="top">
            <img src="/assets/activity/lighting/images/hongyan.png">
            <span>分享给好友，帮你点灯赢电影票！</span>
            <span class="concern fl-right">分享<span class="iconfont icon-youjiantou2"></span></span>
        </a>
    </if>
        <eq name="data.logo" value="$logo" >
        	<img src="/assets/activity/lighting/images/logo.png">
        <else/>
        	<img src="{BEESCRM:$data.logo}">
        </eq>
        
    </div>
    <div class="lottery-wraper">
        <p>邀请好友点亮鸿雁智能情景灯</br>
            赢取免费电影票！可看任意电影哟！</p>
        <div class="lottery-panel">
	        <input type="hidden" id="act_id" value="{BEESCRM:$act_id}"/>
	        <input type="hidden" id="wechat_id" value="{BEESCRM:$wechat_id}"/>
	        <input type="hidden" id="fans_id" value="{BEESCRM:$fans_id}"/>
	        <input type="hidden" id="from_fans_id" value="{BEESCRM:$from_fans_id}"/>
	        <input type="hidden" id="origin" value="{BEESCRM:$origin}" />
            <ul class="lottery-list clearfix">
	            <volist name="data.LightingSet" id="vo" key="i">
	            	<a href="{BEESCRM:$vo.url}"><li class="item-{BEESCRM:$vo.sort} <neq name='vo.be_light' value='1'>light-img</neq> "><img src="/assets/activity/lighting/images/light{BEESCRM:$i}.png"></li></a>
	            </volist>
            </ul>
            <div>
                <img class="light" src="/assets/activity/lighting/images/light.png">
                <if condition="$log eq 1">
               		<div class="start" id="start">
	                	<img src="/assets/activity/lighting/images/start.png">
	                </div>
                 <elseif condition="$log eq 2"/>
                	<div class="start" id="start">
	                	<img src="/assets/activity/lighting/images/light-on.png">
	                </div>
                <elseif condition="$log eq 3"/>
                	<div class="start" id="start">
	                	<img src="/assets/activity/lighting/images/share.png">
	                </div> 
	             <elseif condition="$log eq 4"/>
                	<div class="start" id="start">
	                	<img src="/assets/activity/lighting/images/lightfor.png">
	                </div> 
	             <elseif condition="$log eq 5"/>
                	<div class="start" id="start">
	                	<img src="/assets/activity/lighting/images/lightfor.png">
	                </div> 
                </if>
            </div>
        </div>
    </div>
    <div class="wave-bottom"></div>
	    <p class="label">
	        鸿雁智能情景灯,<br/>
	        电影《土豪520》中吴镇宇的求爱神器！
	    </p>
    <div class="ticket-box">
        <span class="line"></span>
        <div class="ticket clearfix">
           
            <volist name="data.Prize" id="vo">
            	<div class="ticket-list fl-left">
	                <p class="num">点亮{BEESCRM:$vo.light_num}盏</p>
	                <span class="ring"></span>
	                <p class="type"><span class="iconfont icon-zuoceyouhuiquan2"></span> {BEESCRM:$vo.name}</p>
	                <p>电影券</p>
	                <p style="font-size: 12px;">任选电影</p>
	                <if condition="$extra eq 1">
	                	<img class="none" src="/assets/activity/lighting/images/none.png">
	                </if>
	            </div>
            </volist>
            
        </div>
    </div>
    
    <p class="label">
        还剩 <span class="type">{BEESCRM:$remain}</span> 份电影票！ 想要的抓紧了！
    </p>
    <div class="mes"><span class="circle fl-left"><span class="iconfont icon-zan zan"></span></span>已有 {BEESCRM:$lightCount} 人为<eq name="mine" value="1">你<else/>他</eq>点灯</div>
    <div class="adds">
        <img src="/assets/activity/lighting/images/bill.jpg"/>
        <a class="rule" href="#">点击查看活动规则</a>
        
        <volist name="data.Ad" id="vol">
	        <eq name="vol." value="$logo" >
	        	<img class="adds-img" src="/assets/activity/lighting/images/adds.jpg"/>
	        <else/>
	        	<a href="{BEESCRM:$vol.url}">
	        		<img class="adds-img" src="{BEESCRM:$vol.pic}" title="{BEESCRM:$vol.title}">
	        	</a>
	        </eq>
        </volist>
                
        <a href="{BEESCRM:$subscribe_url}"><p class="copy-right">技术支持：杭州青橄榄网络技术有限公司</p></a>
    </div>

    <neq name="mine" value="1">
	    <div>
	    	<a href="{BEESCRM::U('activity/lighting/index',array('wechat_id' => $wechat_id, 'act_id' => $act_id,'origin'=>$from_fans_id ))}" class="btn">我也要玩</a>
	    </div>
    </neq>
		<div class="pop-box" >
	        <div class="share"><img src="/assets/activity/lighting/images/share_icon.png"/></div>
	        <div class="main">
	            <p>恭喜你</p>
	            <p>成功点亮1盏灯！</p>
	            <p>分享朋友圈</p>
	            <p>邀请好友为你点灯</p>
	            <p>赢取免费电影票！</p>
	            <a class="share-btn">我知道了</a>
	        </div>
	    </div>
	    
	<if condition="$prizeinfo">
			<div class="pop-box" id="prizeInfo">
		        <div class="main">
		            <span class="iconfont icon-duigou duigou"></span>
		            <input type="hidden" value="{BEESCRM:$prizeinfo.prize_id}" id="prize_id"/>
		            <p>恭喜你获得 <span class="type" style="font-size: 20px">{BEESCRM:$prizeinfo.name}</span> 电影券！</p>
		            <p>你可以选择立即领取电影券，或者继续冲击更高奖项！</p>
		            <div class="btn-box clearfix">
		                <a class="btn-small yellow-btn fl-left" href="javascript:void(0)" id="getPrize">立即领奖</a>
		                <a class="btn-small pink-btn fl-left close-btn" href="javascript:void(0)">继续冲击大奖</a>
		            </div>
		        </div>
		    </div>
	 		<if condition="$subscribe eq 0 " >
			    <div class="pop-box" id="noSubscribe">
			        <div class="main" >
			            <span class="iconfont icon-duigou duigou"></span>
			            <p>恭喜你获得 <span class="type" style="font-size: 20px">{BEESCRM:$prizeinfo.name}</span> 电影券！</p>
			            <p>详细获奖信息<br/>请前往鸿雁电器公众号领取</p>
			            <div class="btn-box">
			                <a class="btn-small" href="{BEESCRM:$subscribe_url}"><img src="/assets/activity/lighting/images/btn.jpg"/></a>
			                <a class="btn-small green-btn" href="{BEESCRM:$subscribe_url}">去看看</a>
			            </div>
			        </div>
			    </div>
		    </if>
    </if>
    <div class="pop-box">
        <div class="main">
            <span class="iconfont icon-duigou duigou"></span>
            <p>先关注， 后送票！</p>
            <p>免费电影票在这里！赶快关注鸿雁公众号！</p>
            <div class="btn-box">
                <a class="btn-small" href="{BEESCRM:$subscribe_url}"><img src="/assets/activity/lighting/images/btn.jpg"/></a>
                <a class="btn-small green-btn" href="{BEESCRM:$subscribe_url}">去看看</a>
            </div>
        </div>
    </div>
    
    <div class="pop-box1">
		<img class="load-bee" src="/assets/activity/footprint/images/load-bee.png"/>

	</div>
</div>

<script src="/assets/activity/lighting/js/jquery-2.1.0.min.js"></script>
<!-- <script type="text/javascript" src="/assets/activity/lighting/js/support.js"></script> -->
<script type="text/javascript" src="/assets/activity/lighting/js/grayscale.js"></script>
<script type="text/javascript" src="/assets/activity/lighting/js/lottery.js"></script>
<script type="text/javascript" src="/assets/activity/lighting/js/slick.min.js"></script>
<script type="text/javascript" src="/assets/activity/lighting/js/fastclick.min.js"></script>
<script type="text/javascript">
	$(window).load(function(){
	    $('.pop-box1').hide();
	});
    $(function () {
        $('.start').marqueeImg();
         $(document).on('click','.share-btn',function(){
        	 $(this).closest('.pop-box').remove();
             $(this).closest('.pop-box').hide();
         });
         
         <if condition="$prizeinfo">
         	$('#prizeInfo').show();
         	
         	$(document).on('click','#getPrize',function(){
         		var prize_id = $('#prize_id').val();
         		$.ajax({
         			url:"{BEESCRM::U('Activity/Lighting/ajaxGetPrize',array('wechat_id'=>$wechat_id,'act_id'=>$act_id,'origin'=>$origin))}",
         			type:'post',
         			data:{'prize_id':prize_id},
         			dataType:'json',
         			success:function(data){
         				console.log(data);
         				var url = "{BEESCRM::U('Activity/Lighting/prize',array('wechat_id'=>$wechat_id,'act_id'=>$act_id))}"+'/id/'+data.id;
         				if(data.status == 'S'){
         					if(data.subscribe == 0){
         						$('.close-btn').closest('.pop-box').hide();
         						$('#noSubscribe').show();
         					}else{
         						infotips(data.message, $('.submit_tips'),'right');
         						setTimeout("location.href = '"+ url+"'",2000);
         					}
         				}else{
         					infotips(data.message, $('.submit_tips'));
         				}
         			},
         			error:function(){
         				infotips('网络不给力，通讯失败!', $('.submit_tips'));
         			}
         		})
         	});
         	
         </if>
         
        $('.close-btn').click(function(){
        	$(this).closest('.pop-box').hide();
        })
    });
</script>
</body>

</html>
